<?php
    $hide=$_REQUEST["hide"];
    $conn=mysqli_connect("127.0.0.1","root","","jc");
    mysqli_query($conn,"SET NAMES utf8");
    if($hide=="loldata"){
        $sql="SELECT * FROM lol";
        $rs=mysqli_query($conn,$sql);
        $arr=[];
        while(($row=mysqli_fetch_assoc($rs))!=null){
            Array_push($arr,$row);
        }
        // echo JSON_encode($arr); 
        echo $_GET["key"]."(".JSON_encode($arr).")";
    }else if($hide=="cfdata"){
        $sql="SELECT * FROM cf";
        $rs=mysqli_query($conn,$sql);
        $arr=[];
        while(($row=mysqli_fetch_assoc($rs))!=null){
            Array_push($arr,$row);
        }
        echo JSON_encode($arr); 
    }else if($hide=="bnsdata"){
        $sql="SELECT * FROM bns";
        $rs=mysqli_query($conn,$sql);
        $arr=[];
        while(($row=mysqli_fetch_assoc($rs))!=null){
            Array_push($arr,$row);
        }
        echo JSON_encode($arr); 
    }else if($hide=="ylztdata"){
        $sql="SELECT * FROM ylzt";
        $rs=mysqli_query($conn,$sql);
        $arr=[];
        while(($row=mysqli_fetch_assoc($rs))!=null){
            Array_push($arr,$row);
        }
        echo JSON_encode($arr); 
    }else if($hide=="gamedata"){
        $sql="SELECT * FROM gamebox";
        $rs=mysqli_query($conn,$sql);
        $arr=[];
        while(($row=mysqli_fetch_assoc($rs))!=null){
            Array_push($arr,$row);
        }
        echo JSON_encode($arr); 
    }
    
?>